package com.wiscamp.ninechapters.problems.infrastructure.mappers.reports;

import com.wiscamp.ninechapters.problems.infrastructure.po.reports.TaskReportContentPO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

@Repository
public interface TaskReportContentMapper extends JpaRepository<TaskReportContentPO, Long>, JpaSpecificationExecutor<TaskReportContentPO> {

    /**
     * 通过任务编号获取练习任务
     *
     * @param taskId
     * @return
     */
    @Query(value = "select e from TaskReportContentPO e where e.taskId = :taskId")
    TaskReportContentPO findByTask(long taskId);
}